home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / os2 / pmgb202.zip / SPIN.PMG < prev    next >
Text File  |  1992-09-21  |  1KB  |  22 lines

  1. /* Spin the globe with sun position held static */
  2. /* (Note: currently this 'undoes' positions set interactively while running */
  3. /* fixing this is left as an exercise for the reader.)                      */
  4. 'set title PMGlobe - Slow spin'         /* sample title */
  5. 'extract viewlat viewlon sunlat sunlon' /* get current */
  6. offlat=sunlat-viewlat                   /* relative sun latitude  */
  7. offlon=sunlon-viewlon                   /* relative sun longitude */
  8.  
  9. do forever                              /* (Use Halt Macro to end) */
  10.   'wait +0:05'                          /* redraw every 5 minutes */
  11.   'extract sunlat sunlon'               /* get new sun position */
  12.   lon=sunlon-offlon                     /* calculate new view lon */
  13.   if lon<-180 then lon=lon+360          /* if wrapped past dateline.. */
  14.    else if lon>180 then lon=lon-360     /* .. adjust as needed */
  15.   'set viewlon' lon                     /* new longitude */
  16.   lat=sunlat-offlat                     /* calculate new view lat */
  17.   if lat<-90 then lat=-lat-180          /* if wrapped over a pole.. */
  18.    else if lat>90 then lat=180-lat      /* .. adjust as needed */
  19.   'set viewlat' lat                     /* .. and set */
  20.   end
  21.  
  22.